# 1.导包
import time
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By

# 2.创建浏览器驱动对象
# Firefox浏览器:
# driver = webdriver.Firefox()
# Chrome浏览器:
path = r"D:\Programs\Python\Python313\chromedriver.exe"
ser = Service(executable_path = path)
driver = webdriver.Chrome(service = ser)
# 使用Edge浏览器,不需要安装驱动
# driver = webdriver.Edge ()
# 3.打开Web页面
driver.get("http://121.43.169.97:8848/pageA.html")
# 4.页面操作
# 4.1 定位到元素
driver.find_element(by=By.CLASS_NAME, value="telA").send_keys("18611111111")
# class有多个值时,选中一个即可.但是最好还是换一种方式定位
driver.find_element(by=By.CLASS_NAME, value="emailA").send_keys("123@qq.com")
# 5.暂停
time.sleep(3)
# .关闭浏览器驱动对象
driver.quit()